﻿using University.Workshop.Business;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using University.Workshop.Model;
using University.Workshop.DataAccess;
using System.Collections.ObjectModel;

namespace University.Workshop.Tests
{
    /// <summary>
    ///This is a test class for ProductRecommendationManagerTest and is intended
    ///to contain all ProductRecommendationManagerTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ProductRecommendationManagerTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for GetProductByCategory
        ///</summary>
        [TestMethod()]
        public void GetProductByCategoryTest()
        {
            Product prod = ProductRegistrationManager.RegisterNewProduct("iPhone 2 16GB apple", "5234", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            Collection<Product> actual;
            actual = ProductRecommendationManager.GetProductByCategory(prod.Category, prod.ProductId);

        }

        /// <summary>
        ///A test for GetProductByCategory
        ///</summary>
       


        /// <summary>
        ///This is a test class for ViewProductManagerTest and is intended
        ///to contain all ViewProductManagerTest Unit Tests
        ///</summary>
        [TestClass()]
        public class ViewProductManagerTest
        {


            private TestContext testContextInstance;

            /// <summary>
            ///Gets or sets the test context which provides
            ///information about and functionality for the current test run.
            ///</summary>
            public TestContext TestContext
            {
                get
                {
                    return testContextInstance;
                }
                set
                {
                    testContextInstance = value;
                }
            }

            #region Additional test attributes
            // 
            //You can use the following additional attributes as you write your tests:
            //
            //Use ClassInitialize to run code before running the first test in the class
            //[ClassInitialize()]
            //public static void MyClassInitialize(TestContext testContext)
            //{
            //}
            //
            //Use ClassCleanup to run code after all tests in a class have run
            //[ClassCleanup()]
            //public static void MyClassCleanup()
            //{
            //}
            //
            //Use TestInitialize to run code before running each test
            //[TestInitialize()]
            //public void MyTestInitialize()
            //{
            //}
            //
            //Use TestCleanup to run code after each test has run
            //[TestCleanup()]
            //public void MyTestCleanup()
            //{
            //}
            //
            #endregion


            /// <summary>
            ///A test for GridLoad
            ///</summary>
            [TestMethod()]
            public void GridLoadTest()
            {
                Collection<Product> expected = ProductDataAccess.ViewAllProductsOnSale();
                Collection<Product> actual = ViewProductManager.GridLoad();
            }

            /// <summary>
            ///A test for LoadCompleteInformation
            ///</summary>
            [TestMethod()]
            public void LoadCompleteInformationTest()
            {
                string id = "1"; // TODO: Initialize to an appropriate value
                object actual;
                actual = ViewProductManager.LoadCompleteInformation(id);
                ProductDataAccess.DescriptionProduct(id);
            }

            /// <summary>
            ///A test for LoadCompleteInformation
            ///</summary>

        }


        /// <summary>
        ///This is a test class for UserCancelAccountManagerTest and is intended
        ///to contain all UserCancelAccountManagerTest Unit Tests
        ///</summary>
        [TestClass()]
        public class UserCancelAccountManagerTest
        {


            private TestContext testContextInstance;

            /// <summary>
            ///Gets or sets the test context which provides
            ///information about and functionality for the current test run.
            ///</summary>
            public TestContext TestContext
            {
                get
                {
                    return testContextInstance;
                }
                set
                {
                    testContextInstance = value;
                }
            }

            #region Additional test attributes
            // 
            //You can use the following additional attributes as you write your tests:
            //
            //Use ClassInitialize to run code before running the first test in the class
            //[ClassInitialize()]
            //public static void MyClassInitialize(TestContext testContext)
            //{
            //}
            //
            //Use ClassCleanup to run code after all tests in a class have run
            //[ClassCleanup()]
            //public static void MyClassCleanup()
            //{
            //}
            //
            //Use TestInitialize to run code before running each test
            //[TestInitialize()]
            //public void MyTestInitialize()
            //{
            //}
            //
            //Use TestCleanup to run code after each test has run
            //[TestCleanup()]
            //public void MyTestCleanup()
            //{
            //}
            //
            #endregion


            /// <summary>
            ///A test for CancelUserAccount
            ///</summary>
            [TestMethod()]
            public void CancelUserAccountTest()
            {
                string email = "admin@admin.com"; // TODO: Initialize to an appropriate value
                string password = "admin1"; // TODO: Initialize to an appropriate value
                User expected = UserCancelAccountManager.CancelUserAccount(email, password);
            }

            /// <summary>
            ///A test for ReactiveUserAccount
            ///</summary>
            [TestMethod()]
            public void ReactiveUserAccountTest()
            {
                User user = UserDataAccess.GetUserByEmail("admin@admin.com");
                UserCancelAccountManager.ReactiveUserAccount(user);

            }
        }
    }
}
